<template>
  <div>
    <div class="m-swiper-outbox">
      <md-swiper :autoplay="5000">
        <md-swiper-item >
          <img src="../../assets/img/img1.jpeg" alt="swiper">
        </md-swiper-item>
        <md-swiper-item >
          <img src="../../assets/img/img2.png" alt="swiper">
        </md-swiper-item>
      </md-swiper>
    </div>

    <div class="m-notifition">
      <i class="iconfont icon-volume-up-line"></i>
      <span>中国区5050系统上市了</span>
    </div>

    <div class="m-income-box">
      <div class="title">我的收益</div>
      <div class="value">
        {{wdsy}}
        <span></span>
      </div>
      <div class="use-info">
        <div class="left">1=6USDT</div>
        <div class="right"  @click="gowfjs()">
          <span>玩法介绍</span>
          <i class="iconfont icon-error-warning-line"></i>
        </div>
      </div>
    </div>

    <div class="task-title">更多信息</div>
    <div class="task-item-box">
      <div class="task-item">
        <div class="node-title">会员管理</div>
        <div class="node-info">帮助下级注册用户</div>
      </div>
      <div class="task-item"  @click="$router.push('/user')">
         <div class="node-title">个人信息</div>
      </div>
      <div class="task-item" @click="$router.push('/apply_help')">
         <div class="node-title">申请帮助</div>
      </div>
      <div class="task-item" @click="$router.push('/matching')">
         <div class="node-title">确认订单</div>
        <div class="node-info">打款订单确认</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { ISwiperItem } from "@/types";
import { Swiper, SwiperItem } from "mand-mobile";
import {Toast} from 'mand-mobile'
@Component({
  name: "Tab1",
  components: {
    [Swiper.name]: Swiper,
    [SwiperItem.name]: SwiperItem
  },
    created: function () {
        Toast.loading("请求中...");
        let usera = JSON.parse(localStorage.getItem('users1'));
        if(usera==null){
            Toast.hide();
            this.$router.push({
                path: '/login'
            })
            return;
        }
        this.$api.paysum({"search_EQ_payuser": usera.username}).then(res => {
            Toast.hide();
            if (res.success == 200) {
                this.wdsy = res.data.money;
                // this.formData_1.commit=usera.username;
                console.log(res.data);
            }
        }).catch(res => {
            Toast.hide();
        })


    }
})
export default class extends Vue {
  // =========== 变量区 ============
  swiperData: ISwiperItem[] = [
    {
      imgUrl: "../assets/img/img1.jpeg",
      link: ""
    },
    {
      imgUrl: "../assets/img/img2.png",
      link: ""
    }
  ];
  wdsy=0;
  taskData = [
    {
      label: "1星任务",
      value: 1
    },
    {
      label: "2星任务",
      value: 2
    },
    {
      label: "3星任务",
      value: 3
    },
      {
          label: "4星任务",
          value: 4
      },
      {
          label: "5星任务",
          value: 5
      },
      {
          label: "6星任务",
          value: 6
      },
      {
          label: "7星任务",
          value: 7
      },
      {
          label: "8星任务",
          value: 8
      }
  ];

  // =========== 方法区 ============
  goBuy(val) {
      let mon=100 *Math.pow(2,val);
      this.$router.push({path: '/buy', query: {key:val,money:mon}})

  }
    gowfjs(){
        this.$router.push({
            path: '/explain'
        })
    }
}
</script>


